package com.crm.jdy.service.client;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.crm.jdy.common.dto.ClientSourceInfoDto;
import com.crm.jdy.common.mapper.ClientInvoiceInfoMapper;
import com.crm.jdy.common.pojo.ClientChargeInfo;
import com.crm.jdy.common.pojo.ClientSourceInfo;
import com.crm.jdy.common.mapper.ClientSourceInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import java.util.List;

/**   
 * @Description:(客户商机信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class ClientSourceInfoServiceImpl  extends ServiceImpl<ClientSourceInfoMapper,ClientSourceInfo> implements ClientSourceInfoService  {

    @Autowired
    ClientSourceInfoMapper clientSourceInfoMapper;


    @Override
    public PageInfo<ClientSourceInfo> seleteClientSourceInfo(ClientSourceInfoDto clientSourceInfoDto) {
            PageHelper.startPage( clientSourceInfoDto.getCurrentPage(),clientSourceInfoDto.getPageSize());
            List<ClientSourceInfo> bookList = clientSourceInfoMapper.seleteClientChargeInfo(clientSourceInfoDto);
            PageInfo<ClientSourceInfo> pageInfo = new PageInfo<ClientSourceInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateClientSourceInfo(ClientSourceInfo clientSourceInfo) {
        return clientSourceInfoMapper.updateById(clientSourceInfo) > 0;
    }

    @Override
    public boolean addClientSourceInfo(ClientSourceInfo clientSourceInfo) {
        return clientSourceInfoMapper.insert(clientSourceInfo) > 0;
    }

    @Override
    public boolean removeClientSourceInfo(String aplanId) {
        return clientSourceInfoMapper.deleteById(aplanId) > 0;
    }


}